<template>
  <div class="setting">
    <div class="nav-row">
      <div class="close-content" @click.stop="goBack">
        <span class="icon iconfont close">&#xe748;</span>
      </div>
    </div>
    <div class="u-page">
      <div
        class="set-row"
        v-for="item in data"
        :key="item.id"
        @click.stop="goToAgree(item)"
      >
        <div class="u-icon u-icon--right"></div>
        <div class="set-name">{{ item.title }}</div>
        <div class="u-icon u-icon--right">
          <div
            hover-class=""
            class="u-icon__icon uicon-arrow-right"
            style="
              font-size: 16px;
              line-height: 16px;
              font-weight: normal;
              top: 0px;
              color: rgb(153, 153, 153);
            "
          >
            <span class="icon iconfont back">&#xe6dc;</span>
          </div>
          <!---->
        </div>
      </div>
      <div  class="set-btn"><div class="set-btn-text" @click="logout">LOGIN OUT</div></div>
    </div>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
export default {
  name: "setting",
  data() {
    return {
      data: [
        {
          title: "AML Policy",
          id: 1,
        },
        {
          title: "User Agreement",
          id: 7,
        },
        {
          title: "Privacy Policy",
          id: 8,
        },
        {
          title: "User Recharge Agreement",
          id: 17,
        },
        {
          title: "Cookie policy",
          id: 24,
        },
        {
          title: "Cash withdrawal agreement",
          id: 25,
        },
      ],
    };
  },
  methods: {
    ...mapMutations(["setUserInfo", "setIsLogin"]),
    goBack() {
      this.$router.go(-1);
    },
    logout(){
       this._routeLogin()
       this.setUserInfo({})
       this.setIsLogin(0)
    },
    goToAgree(item) {
      this.$router.push({
        name: "agreement",
        query: {
          id: item.id,
          title: item.title,
        },
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.setting {
  box-sizing: border-box;
  .nav-row {
    height: 44px;
    padding: 0 10px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-top: calc(0px);
    .close-content {
      width: 30px;
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      .close {
        color: var(--text-color);
        font-size: 22px;
        font-weight: 500;
      }
    }
  }

  .u-page {
    padding: 10px 15px;
    .set-row {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      height: 55px;
      background-color: var(--content-bc);
      padding: 0 6px;
      box-sizing: border-box;
      border-radius: 7px;
      margin-bottom: 10px;
      .u-icon__icon {
        font-family: uicon-iconfont;
        position: relative;
        display: flex;
        flex-direction: row;
        align-items: center;
      }
      .u-icon--right {
        flex-direction: row;
        align-items: center;
        .back {
          transform: rotate(180deg);
          font-size: 22px;
          font-weight: 700;
        }
      }
      .set-name {
        font-size: 16px;
        font-weight: 400;
        margin-left: 10px;
        color: var(--text-color);
        margin-right: auto;
      }
    }

    .set-btn {
      width: 100%;
      height: 47px;
      background: #00dcab;
      opacity: 1;
      border-radius: 7px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top: 104px;
       .set-btn-text {
    margin-left: 10px;
    font-size: 16px;
    color: #fff;
}
    }
  }
}
</style>